package com.nineclock.message.controller;

import com.nineclock.api.message.MessageControllerApi;
import com.nineclock.common.entity.Result;
import com.nineclock.message.dto.NcMessageDto;
import com.nineclock.message.dto.NcMessageQueryDTO;
import com.nineclock.message.service.NcMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/message")
public class MessageController implements MessageControllerApi {
    /**
     * 获取文档推送历史记录
     *
     * @param ncMessageQueryDTO
     * @return
     */
    @Autowired
    NcMessageService ncMessageService;
    @GetMapping
    @Override
    public Result<List<NcMessageDto>> findMessageHistory(NcMessageQueryDTO ncMessageQueryDTO) {
        List<NcMessageDto> list = ncMessageService.findMessageHistory(ncMessageQueryDTO);
        return Result.success(list);
    }
}
